import {createRouter, createWebHashHistory, createWebHistory} from "vue-router"
import JobView from "../components/JobView.vue";
import PieChart from "../components/PieChart.vue";
import WordChart from "../components/WordChart.vue";
import ScoreModel from "../components/ScoreModel.vue";
import KmeansModel from "../components/KmeansModel.vue";
import SalaryView from "../components/SalaryView.vue";

const routes = [
    {
        path: '/job-view',
        component: JobView
    },
    {
        path: '/pie-chart',
        component: PieChart
    },
    {
        path: '/word-chart',
        component: WordChart
    },
    {
        path: '/score-model',
        component: ScoreModel
    },
    {
        path: '/kmeans-model',
        component: KmeansModel
    },
    {
        path: '/salary',
        component: SalaryView
    }
]

// 3. 创建路由实例
const router = createRouter({
    // （1）采用hash 模式
    history: createWebHashHistory(),
    // （2）采用 history 模式
    // history: createWebHistory(),
    routes, //使用上方定义的路由配置
})

// 4. 导出router
export default router